package com.cooksys.film_rental.dao;

import java.util.List;

import com.cooksys.film_rental.model.City;
import com.cooksys.film_rental.model.Country;

/**
 * Data access object for the {@link Country} class
 * 
 * @author Peter Zastoupil
 * 
 */
public interface CountryDao {

	/**
	 * Saves a given {@link Country} as a record in the database
	 * 
	 * @param country
	 *            the Country to save
	 * @return the {@link Country} that was saved
	 */
	public Country save(Country country);

	/**
	 * Updates the database record associated with the given {@link Country}
	 * 
	 * @param country
	 *            the Country to be updated
	 */
	public void update(Country country);

	/**
	 * Deletes the database record associated with the given {@link Country}
	 * 
	 * @param country
	 *            the Country to be deleted
	 */
	public void delete(Country country);

	/**
	 * 
	 * @param countryId
	 *            the countryId to search by
	 * @return a {@link Country} object that corresponds to the given countryId
	 */
	public Country getCountryByCountryId(Short countryId);

	/**
	 * 
	 * @param city
	 *            the {@link City} to search by
	 * @return the {@link Country} object associated with the given city
	 */
	public Country getCountryByCity(City city);

	/**
	 * 
	 * @param partialCountryName
	 *            the partialCountryName to search by
	 * @return a List of {@link Country} objects that match the given
	 *         partialCountryName
	 */
	public List<Country> searchCountriesByPartialCountryName(
			String partialCountryName);

	/**
	 * 
	 * @return a List of all available {@link Country} objects
	 */
	public List<Country> getAllCountries();

	/**
	 * 
	 * @param country
	 *            the country name to search by
	 * @return the first {@link Country} object in the database that matches the
	 *         given country name, or <code>null</code> if no match can be found
	 */
	public Country getCountryByInfo(String country);

}
